package org.learn.java.utill;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.UUID;

public class MyUtill {
	
	public static void main(String[] args) {
		//System.out.println(myId());
		getProperty("a");
	}

	/**
	 * JDK自动生成主键
	 * @return
	 */
	public static String myId(){
		return UUID.randomUUID().toString().replace("-", "");
	}
	
	public static Properties getProperty(String path){
		path="/my.property";
		Properties pro=new Properties();
		
		try {
			InputStream in = MyUtill.class.getResourceAsStream(path);
			pro.load(in);
			System.out.println(pro.getProperty("userId"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return pro;
		
	}
}
